home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _C99DAB89EA9740528623AD85231E3485 < prev    next >
Text File  |  2004-11-23  |  614b  |  31 lines

  1. //shader to clip any pixels with a Z coordinate below the water plane
  2. //modulates color from vertex with texture sample
  3. //must be used with clipZ_lit.vsh
  4. //Luke Lenhart
  5. //(C)2004-2005 Digipen Institute of Technology
  6.  
  7. //base texture
  8. sampler2D sampTex;
  9.  
  10. //shader input
  11. struct PS_INPUT
  12. {
  13.     float4 Pos : TEXCOORD1;
  14.     float2 Tex0 : TEXCOORD0;
  15.     float4 Color : COLOR;
  16. };
  17.  
  18. //shader
  19. float4 PShader(PS_INPUT In) : COLOR
  20. {
  21.     //cut out pixel if it's below z=0
  22.     clip(In.Pos.z);
  23.     
  24.     //sample texture and scale by color
  25.     float4 clr=tex2D(sampTex,In.Tex0);
  26.     clr*=In.Color;
  27.     
  28.     //
  29.     return clr;
  30. };
  31.